package p1;

public class PrintArray {

	private static void print( int[] a ){
		for (int thing : a)
			System.out.print( " " + thing );
	}
	
	private static void print_rec( int[] a, int n ){
		if (n==0)
			return;
		print_rec( a, n-1 );
		System.out.print( " " + a[n-1] );
	}
	
	
	private static void print_rec( int[] a ){
		print_rec( a, a.length );
	}
	
	
	
	public static void main(String[] args) {
		int[] a = new int[5];
		for (int i=0; i<a.length; i++)
			a[i] = (int) (Math.random() * 10);
		
		System.out.print("Iterative: [ ");
		print( a );
		System.out.println(" ]");

		System.out.print("Recursive: [ ");
		print_rec( a );
		System.out.println(" ]");
	}

}
